#pragma once

#include <list>
#include <string>
#include "ActionNode.h"
#include "PPR.h"
#include <fstream>
#include <sstream>
#include <iostream>
#include <hash_map>

using namespace std;
using namespace stdext;

struct PPRObservationAction
{
	string observation;
	string action;
	string state;
};

class BuilderCSV
{
private:
	//list<PPRObservationAction> BuilderCSV::ConvertDataToPairs(string inputFile, string actionCol, vector<string> actions, string observationCol, vector<string> observations, string stateCol, vector<string> states);
	//list<PPRObservationAction> BuilderCSV::ConvertDataToPairs(list<string> inputRows, string actionCol, vector<string> actions, string observationCol, 
	//															vector<string> observations, string stateCol, vector<string> states, vector<string> joinStates);
	list<PPRObservationAction> BuilderCSV::ConvertDataToPairs(list<string> inputRows, string actionCol, vector<string> actions, string observationCol, 
																vector<string> observations, vector<string> joinStates);
	hash_map<string, PPR> BuilderCSV::PairsToTrees(hash_map<string, PPR> branches, list<PPRObservationAction> pairs, vector<string> observations, int treeLength);
	hash_map<string, PPR> BuilderCSV::MergeBranchInWithTrees(hash_map<string, PPR> branches, PPR branch);

	bool BuilderCSV::Is_number(string s);


public:
	BuilderCSV(void);
	hash_map<string, PPR> BuilderCSV::BuildFromCSV(hash_map<string, PPR> branches, string inputFile, string actionCol, vector<string> actions, 
													string observationCol, vector<string> observations, string stateCol, int treeLength, 
													vector<string> states, vector<string> joinStates);	
	hash_map<string, PPR> BuilderCSV::BuildFromCSV(hash_map<string, PPR> branches, list<string> inputRows, string actionCol, vector<string> actions, 
													string observationCol, vector<string> observations, string stateCol, int treeLength, 
													vector<string> states, vector<string> joinStates);	
};

